﻿Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient

Public Class frmTS_Sotaisan
    Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    ' Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
    Friend WithEvents DataGridView1 As MyDataGridView
    Friend WithEvents MatinhDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents TentinhDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents MamienDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataSetFormDonBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents DataSetForm_Don As MEKONG.DataSetForm_Don
    Friend WithEvents Manhom As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents Tennhom As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ghichu As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents Column1 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ngayct As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents tg As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents mats As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents tents As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents diengiai As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents soluong As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents trigia As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents khauhao As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents txtNam As System.Windows.Forms.TextBox
    Friend WithEvents lblNam As System.Windows.Forms.Label
    Friend WithEvents txtThang As System.Windows.Forms.TextBox
    Friend WithEvents lblThang As System.Windows.Forms.Label
    Friend WithEvents btnXemCDTK As System.Windows.Forms.Button
    Friend WithEvents btnThoat As System.Windows.Forms.Button
    Friend WithEvents Column2 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents SoctDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NgayctDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents TentsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NuocsxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NgaysdDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents MatsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NguyengiaDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents TylekhauhaoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents MuckhauhaoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents KhauhaoluykeDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ManhomDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents TennhomDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents RecycleidDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DiengiaiDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents LoaitanggiamDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents MapbDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents TenpbDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents btnInBaoCao As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Me.Label1 = New System.Windows.Forms.Label
        Me.DataGridView1 = New MEKONG.MyDataGridView
        Me.DataSetFormDonBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DataSetForm_Don = New MEKONG.DataSetForm_Don
        Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ngayct = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.tg = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.mats = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.tents = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.diengiai = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.soluong = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.trigia = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.khauhao = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.txtNam = New System.Windows.Forms.TextBox
        Me.lblNam = New System.Windows.Forms.Label
        Me.txtThang = New System.Windows.Forms.TextBox
        Me.lblThang = New System.Windows.Forms.Label
        Me.btnXemCDTK = New System.Windows.Forms.Button
        Me.btnThoat = New System.Windows.Forms.Button
        Me.btnInBaoCao = New System.Windows.Forms.Button
        Me.Column2 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.SoctDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.NgayctDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.TentsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.NuocsxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.NgaysdDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.MatsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.NguyengiaDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.TylekhauhaoDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.MuckhauhaoDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.KhauhaoluykeDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ManhomDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.TennhomDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.RecycleidDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DiengiaiDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.LoaitanggiamDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.MapbDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.TenpbDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetFormDonBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(354, 0)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(238, 31)
        Me.Label1.TabIndex = 11
        Me.Label1.Text = "SỔ TÀI SẢN"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'DataGridView1
        '
        Me.DataGridView1.AllowUserToAddRows = False
        Me.DataGridView1.AllowUserToDeleteRows = False
        Me.DataGridView1.AllowUserToResizeColumns = False
        Me.DataGridView1.AutoGenerateColumns = False
        Me.DataGridView1.BackgroundColor = System.Drawing.Color.LightBlue
        DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.DataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.SoctDataGridViewTextBoxColumn, Me.NgayctDataGridViewTextBoxColumn, Me.TentsDataGridViewTextBoxColumn, Me.NuocsxDataGridViewTextBoxColumn, Me.NgaysdDataGridViewTextBoxColumn, Me.MatsDataGridViewTextBoxColumn, Me.NguyengiaDataGridViewTextBoxColumn, Me.TylekhauhaoDataGridViewTextBoxColumn, Me.MuckhauhaoDataGridViewTextBoxColumn, Me.KhauhaoluykeDataGridViewTextBoxColumn, Me.ManhomDataGridViewTextBoxColumn, Me.TennhomDataGridViewTextBoxColumn, Me.RecycleidDataGridViewTextBoxColumn, Me.DiengiaiDataGridViewTextBoxColumn, Me.LoaitanggiamDataGridViewTextBoxColumn, Me.MapbDataGridViewTextBoxColumn, Me.TenpbDataGridViewTextBoxColumn})
        Me.DataGridView1.DataMember = "TS_Sotaisan"
        Me.DataGridView1.DataSource = Me.DataSetFormDonBindingSource
        Me.DataGridView1.Location = New System.Drawing.Point(2, 96)
        Me.DataGridView1.Name = "DataGridView1"
        Me.DataGridView1.ReadOnly = True
        Me.DataGridView1.RowHeadersWidth = 25
        Me.DataGridView1.Size = New System.Drawing.Size(1008, 491)
        Me.DataGridView1.TabIndex = 40
        '
        'DataSetFormDonBindingSource
        '
        Me.DataSetFormDonBindingSource.DataSource = Me.DataSetForm_Don
        Me.DataSetFormDonBindingSource.Position = 0
        '
        'DataSetForm_Don
        '
        Me.DataSetForm_Don.DataSetName = "DataSetForm_Don"
        Me.DataSetForm_Don.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'Column1
        '
        Me.Column1.DataPropertyName = "sophieu"
        Me.Column1.HeaderText = "Column1"
        Me.Column1.Name = "Column1"
        '
        'ngayct
        '
        Me.ngayct.DataPropertyName = "ngayct"
        Me.ngayct.HeaderText = "ngayct"
        Me.ngayct.Name = "ngayct"
        '
        'tg
        '
        Me.tg.DataPropertyName = "tg"
        Me.tg.HeaderText = "tg"
        Me.tg.Name = "tg"
        '
        'mats
        '
        Me.mats.DataPropertyName = "mats"
        Me.mats.HeaderText = "mats"
        Me.mats.Name = "mats"
        '
        'tents
        '
        Me.tents.DataPropertyName = "tents"
        Me.tents.HeaderText = "tents"
        Me.tents.Name = "tents"
        '
        'diengiai
        '
        Me.diengiai.DataPropertyName = "diengiai"
        Me.diengiai.HeaderText = "diengiai"
        Me.diengiai.Name = "diengiai"
        '
        'soluong
        '
        Me.soluong.DataPropertyName = "soluong"
        Me.soluong.HeaderText = "soluong"
        Me.soluong.Name = "soluong"
        '
        'trigia
        '
        Me.trigia.DataPropertyName = "trigia"
        Me.trigia.HeaderText = "trigia"
        Me.trigia.Name = "trigia"
        '
        'khauhao
        '
        Me.khauhao.DataPropertyName = "khauhao"
        Me.khauhao.HeaderText = "khauhao"
        Me.khauhao.Name = "khauhao"
        '
        'txtNam
        '
        Me.txtNam.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtNam.Location = New System.Drawing.Point(512, 35)
        Me.txtNam.MaxLength = 4
        Me.txtNam.Name = "txtNam"
        Me.txtNam.Size = New System.Drawing.Size(98, 26)
        Me.txtNam.TabIndex = 42
        Me.txtNam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'lblNam
        '
        Me.lblNam.AutoSize = True
        Me.lblNam.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblNam.Location = New System.Drawing.Point(471, 38)
        Me.lblNam.Name = "lblNam"
        Me.lblNam.Size = New System.Drawing.Size(40, 18)
        Me.lblNam.TabIndex = 47
        Me.lblNam.Text = "Năm"
        '
        'txtThang
        '
        Me.txtThang.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtThang.Location = New System.Drawing.Point(385, 35)
        Me.txtThang.MaxLength = 2
        Me.txtThang.Name = "txtThang"
        Me.txtThang.Size = New System.Drawing.Size(83, 26)
        Me.txtThang.TabIndex = 41
        Me.txtThang.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'lblThang
        '
        Me.lblThang.AutoSize = True
        Me.lblThang.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblThang.Location = New System.Drawing.Point(330, 37)
        Me.lblThang.Name = "lblThang"
        Me.lblThang.Size = New System.Drawing.Size(49, 18)
        Me.lblThang.TabIndex = 46
        Me.lblThang.Text = "Tháng"
        '
        'btnXemCDTK
        '
        Me.btnXemCDTK.Image = Global.MEKONG.My.Resources.Resources.view2
        Me.btnXemCDTK.Location = New System.Drawing.Point(334, 67)
        Me.btnXemCDTK.Name = "btnXemCDTK"
        Me.btnXemCDTK.Size = New System.Drawing.Size(89, 23)
        Me.btnXemCDTK.TabIndex = 43
        Me.btnXemCDTK.UseVisualStyleBackColor = True
        '
        'btnThoat
        '
        Me.btnThoat.BackColor = System.Drawing.Color.LightBlue
        Me.btnThoat.Image = Global.MEKONG.My.Resources.Resources.close
        Me.btnThoat.Location = New System.Drawing.Point(523, 67)
        Me.btnThoat.Name = "btnThoat"
        Me.btnThoat.Size = New System.Drawing.Size(89, 23)
        Me.btnThoat.TabIndex = 45
        Me.btnThoat.UseVisualStyleBackColor = False
        '
        'btnInBaoCao
        '
        Me.btnInBaoCao.BackColor = System.Drawing.Color.LightBlue
        Me.btnInBaoCao.Image = Global.MEKONG.My.Resources.Resources.printreport
        Me.btnInBaoCao.Location = New System.Drawing.Point(429, 67)
        Me.btnInBaoCao.Name = "btnInBaoCao"
        Me.btnInBaoCao.Size = New System.Drawing.Size(89, 23)
        Me.btnInBaoCao.TabIndex = 44
        Me.btnInBaoCao.UseVisualStyleBackColor = False
        '
        'Column2
        '
        Me.Column2.DataPropertyName = "mats"
        Me.Column2.HeaderText = "Column2"
        Me.Column2.Name = "Column2"
        '
        'DataGridViewTextBoxColumn1
        '
        Me.DataGridViewTextBoxColumn1.DataPropertyName = "tents"
        Me.DataGridViewTextBoxColumn1.HeaderText = "tents"
        Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1"
        '
        'SoctDataGridViewTextBoxColumn
        '
        Me.SoctDataGridViewTextBoxColumn.DataPropertyName = "soct"
        Me.SoctDataGridViewTextBoxColumn.HeaderText = "Số hiệu"
        Me.SoctDataGridViewTextBoxColumn.Name = "SoctDataGridViewTextBoxColumn"
        Me.SoctDataGridViewTextBoxColumn.ReadOnly = True
        Me.SoctDataGridViewTextBoxColumn.Width = 75
        '
        'NgayctDataGridViewTextBoxColumn
        '
        Me.NgayctDataGridViewTextBoxColumn.DataPropertyName = "ngayct"
        Me.NgayctDataGridViewTextBoxColumn.HeaderText = "Ngày tháng"
        Me.NgayctDataGridViewTextBoxColumn.Name = "NgayctDataGridViewTextBoxColumn"
        Me.NgayctDataGridViewTextBoxColumn.ReadOnly = True
        Me.NgayctDataGridViewTextBoxColumn.Width = 80
        '
        'TentsDataGridViewTextBoxColumn
        '
        Me.TentsDataGridViewTextBoxColumn.DataPropertyName = "tents"
        Me.TentsDataGridViewTextBoxColumn.HeaderText = "Tên TS"
        Me.TentsDataGridViewTextBoxColumn.Name = "TentsDataGridViewTextBoxColumn"
        Me.TentsDataGridViewTextBoxColumn.ReadOnly = True
        Me.TentsDataGridViewTextBoxColumn.Width = 190
        '
        'NuocsxDataGridViewTextBoxColumn
        '
        Me.NuocsxDataGridViewTextBoxColumn.DataPropertyName = "nuocsx"
        Me.NuocsxDataGridViewTextBoxColumn.HeaderText = "Nước SX"
        Me.NuocsxDataGridViewTextBoxColumn.Name = "NuocsxDataGridViewTextBoxColumn"
        Me.NuocsxDataGridViewTextBoxColumn.ReadOnly = True
        Me.NuocsxDataGridViewTextBoxColumn.Width = 80
        '
        'NgaysdDataGridViewTextBoxColumn
        '
        Me.NgaysdDataGridViewTextBoxColumn.DataPropertyName = "ngaysd"
        Me.NgaysdDataGridViewTextBoxColumn.HeaderText = "Ngày SD"
        Me.NgaysdDataGridViewTextBoxColumn.Name = "NgaysdDataGridViewTextBoxColumn"
        Me.NgaysdDataGridViewTextBoxColumn.ReadOnly = True
        Me.NgaysdDataGridViewTextBoxColumn.Width = 80
        '
        'MatsDataGridViewTextBoxColumn
        '
        Me.MatsDataGridViewTextBoxColumn.DataPropertyName = "mats"
        Me.MatsDataGridViewTextBoxColumn.HeaderText = "Mã TS"
        Me.MatsDataGridViewTextBoxColumn.Name = "MatsDataGridViewTextBoxColumn"
        Me.MatsDataGridViewTextBoxColumn.ReadOnly = True
        Me.MatsDataGridViewTextBoxColumn.Width = 70
        '
        'NguyengiaDataGridViewTextBoxColumn
        '
        Me.NguyengiaDataGridViewTextBoxColumn.DataPropertyName = "nguyengia"
        DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle2.Format = "N0"
        Me.NguyengiaDataGridViewTextBoxColumn.DefaultCellStyle = DataGridViewCellStyle2
        Me.NguyengiaDataGridViewTextBoxColumn.HeaderText = "Nguyên giá"
        Me.NguyengiaDataGridViewTextBoxColumn.Name = "NguyengiaDataGridViewTextBoxColumn"
        Me.NguyengiaDataGridViewTextBoxColumn.ReadOnly = True
        Me.NguyengiaDataGridViewTextBoxColumn.Width = 82
        '
        'TylekhauhaoDataGridViewTextBoxColumn
        '
        Me.TylekhauhaoDataGridViewTextBoxColumn.DataPropertyName = "tylekhauhao"
        DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle3.Format = "N2"
        Me.TylekhauhaoDataGridViewTextBoxColumn.DefaultCellStyle = DataGridViewCellStyle3
        Me.TylekhauhaoDataGridViewTextBoxColumn.HeaderText = "Tỷ lệ KH"
        Me.TylekhauhaoDataGridViewTextBoxColumn.Name = "TylekhauhaoDataGridViewTextBoxColumn"
        Me.TylekhauhaoDataGridViewTextBoxColumn.ReadOnly = True
        Me.TylekhauhaoDataGridViewTextBoxColumn.Width = 60
        '
        'MuckhauhaoDataGridViewTextBoxColumn
        '
        Me.MuckhauhaoDataGridViewTextBoxColumn.DataPropertyName = "muckhauhao"
        DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle4.Format = "N0"
        Me.MuckhauhaoDataGridViewTextBoxColumn.DefaultCellStyle = DataGridViewCellStyle4
        Me.MuckhauhaoDataGridViewTextBoxColumn.HeaderText = "Mức KH"
        Me.MuckhauhaoDataGridViewTextBoxColumn.Name = "MuckhauhaoDataGridViewTextBoxColumn"
        Me.MuckhauhaoDataGridViewTextBoxColumn.ReadOnly = True
        Me.MuckhauhaoDataGridViewTextBoxColumn.Width = 80
        '
        'KhauhaoluykeDataGridViewTextBoxColumn
        '
        Me.KhauhaoluykeDataGridViewTextBoxColumn.DataPropertyName = "khauhaoluyke"
        DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle5.Format = "N0"
        Me.KhauhaoluykeDataGridViewTextBoxColumn.DefaultCellStyle = DataGridViewCellStyle5
        Me.KhauhaoluykeDataGridViewTextBoxColumn.HeaderText = "KH LK"
        Me.KhauhaoluykeDataGridViewTextBoxColumn.Name = "KhauhaoluykeDataGridViewTextBoxColumn"
        Me.KhauhaoluykeDataGridViewTextBoxColumn.ReadOnly = True
        Me.KhauhaoluykeDataGridViewTextBoxColumn.Width = 82
        '
        'ManhomDataGridViewTextBoxColumn
        '
        Me.ManhomDataGridViewTextBoxColumn.DataPropertyName = "manhom"
        Me.ManhomDataGridViewTextBoxColumn.HeaderText = "Mã nhóm"
        Me.ManhomDataGridViewTextBoxColumn.Name = "ManhomDataGridViewTextBoxColumn"
        Me.ManhomDataGridViewTextBoxColumn.ReadOnly = True
        Me.ManhomDataGridViewTextBoxColumn.Width = 60
        '
        'TennhomDataGridViewTextBoxColumn
        '
        Me.TennhomDataGridViewTextBoxColumn.DataPropertyName = "tennhom"
        Me.TennhomDataGridViewTextBoxColumn.HeaderText = "tennhom"
        Me.TennhomDataGridViewTextBoxColumn.Name = "TennhomDataGridViewTextBoxColumn"
        Me.TennhomDataGridViewTextBoxColumn.ReadOnly = True
        Me.TennhomDataGridViewTextBoxColumn.Visible = False
        '
        'RecycleidDataGridViewTextBoxColumn
        '
        Me.RecycleidDataGridViewTextBoxColumn.DataPropertyName = "recycleid"
        Me.RecycleidDataGridViewTextBoxColumn.HeaderText = "recycleid"
        Me.RecycleidDataGridViewTextBoxColumn.Name = "RecycleidDataGridViewTextBoxColumn"
        Me.RecycleidDataGridViewTextBoxColumn.ReadOnly = True
        Me.RecycleidDataGridViewTextBoxColumn.Visible = False
        '
        'DiengiaiDataGridViewTextBoxColumn
        '
        Me.DiengiaiDataGridViewTextBoxColumn.DataPropertyName = "diengiai"
        Me.DiengiaiDataGridViewTextBoxColumn.HeaderText = "diengiai"
        Me.DiengiaiDataGridViewTextBoxColumn.Name = "DiengiaiDataGridViewTextBoxColumn"
        Me.DiengiaiDataGridViewTextBoxColumn.ReadOnly = True
        Me.DiengiaiDataGridViewTextBoxColumn.Visible = False
        '
        'LoaitanggiamDataGridViewTextBoxColumn
        '
        Me.LoaitanggiamDataGridViewTextBoxColumn.DataPropertyName = "loaitanggiam"
        Me.LoaitanggiamDataGridViewTextBoxColumn.HeaderText = "loaitanggiam"
        Me.LoaitanggiamDataGridViewTextBoxColumn.Name = "LoaitanggiamDataGridViewTextBoxColumn"
        Me.LoaitanggiamDataGridViewTextBoxColumn.ReadOnly = True
        Me.LoaitanggiamDataGridViewTextBoxColumn.Visible = False
        '
        'MapbDataGridViewTextBoxColumn
        '
        Me.MapbDataGridViewTextBoxColumn.DataPropertyName = "mapb"
        Me.MapbDataGridViewTextBoxColumn.HeaderText = "mapb"
        Me.MapbDataGridViewTextBoxColumn.Name = "MapbDataGridViewTextBoxColumn"
        Me.MapbDataGridViewTextBoxColumn.ReadOnly = True
        Me.MapbDataGridViewTextBoxColumn.Visible = False
        '
        'TenpbDataGridViewTextBoxColumn
        '
        Me.TenpbDataGridViewTextBoxColumn.DataPropertyName = "tenpb"
        Me.TenpbDataGridViewTextBoxColumn.HeaderText = "tenpb"
        Me.TenpbDataGridViewTextBoxColumn.Name = "TenpbDataGridViewTextBoxColumn"
        Me.TenpbDataGridViewTextBoxColumn.ReadOnly = True
        Me.TenpbDataGridViewTextBoxColumn.Visible = False
        '
        'frmTS_Sotaisan
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.LightBlue
        Me.ClientSize = New System.Drawing.Size(1011, 588)
        Me.Controls.Add(Me.txtNam)
        Me.Controls.Add(Me.lblNam)
        Me.Controls.Add(Me.txtThang)
        Me.Controls.Add(Me.lblThang)
        Me.Controls.Add(Me.btnXemCDTK)
        Me.Controls.Add(Me.btnThoat)
        Me.Controls.Add(Me.btnInBaoCao)
        Me.Controls.Add(Me.DataGridView1)
        Me.Controls.Add(Me.Label1)
        Me.Name = "frmTS_Sotaisan"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "So Tai san"
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetFormDonBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Private data As DataTable
    Private da As MySqlDataAdapter
    Dim sqlQuery As String
    Private Sub txtThang_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtThang.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtNam.Focus()
        End If
    End Sub
    Private Sub txtNam_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtNam.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnXemCDTK.Focus()
        End If
    End Sub

    Private Sub frmTS_Sotaisan_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Escape Then
            Me.Close()
        End If
    End Sub

    Private Sub frmTS_Phongban_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        moduleUtils.setDinhDangVietNam()
        Me.KeyPreview = True
        Me.txtThang.Text = Format(Today.Month, "00")
        Me.txtNam.Text = Format(Today.Year, "0000")
        Me.txtThang.Focus()
    End Sub
    Private Sub btnXemCDTK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXemCDTK.Click
        Dim nam As Integer = Me.txtNam.Text.Trim
        Dim thang As Integer = Me.txtThang.Text
        Dim recycleID As String = nam & Format(thang, "00")

        Me.Cursor = Cursors.WaitCursor
        Dim loadTonCDTK As Integer = tinhton.TS_Sotaisan(nam, Format(thang, "00"))
        Me.Cursor = Cursors.Default
        Dim sqlQuery = "SELECT * FROM TS_Sotaisan WHERE recycleID = '" & recycleID & "' ORDER BY mats "
        Me.DataGridView1.DataSource = moduleDatabaseConn.GetDataTable(sqlQuery)
    End Sub
    Private Sub btnInBaoCao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInBaoCao.Click
        Dim myForm As FrmCrTS_sotaisan = New FrmCrTS_sotaisan
        Dim thang As Integer = Me.txtThang.Text.Trim
        myForm.setThang(Format(thang, "00"))
        myForm.setNam(Me.txtNam.Text.Trim)
        myForm.Show()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub
   
End Class


